﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="aspects"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:c="http://activeattributes.codeplex.com/configuration/schema.xsd"
    targetNamespace="http://activeattributes.codeplex.com/configuration/schema.xsd"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
  <xs:element name="activeattributes">
    <xs:complexType>
      <xs:sequence>
        <!--<xs:element name="aspects" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="add" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="beforeType" type="c:DotNetType" use="required"/>
                  <xs:attribute name="afterType" type="c:DotNetType" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>-->
        <xs:element name="typeOrderings" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="add" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="beforeType" type="c:DotNetType" use="required"/>
                  <xs:attribute name="afterType" type="c:DotNetType" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="ignoreAssemblyDefinedRules" type="xs:boolean" use="optional"/>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="DotNetType">
    <xs:restriction base="c:RequiredStringType">
      <xs:pattern value="(\p{L}[\p{L}\d]*\.)*(\p{L}[\p{L}\d]*\+)*(\p{L}[\p{L}\d]*),\s?([\p{L}\d]+\.)*([\p{L}\d]+)" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="RequiredStringType">
    <xs:restriction base="xs:string">
      <xs:minLength value="1" />
      <xs:whiteSpace value="collapse" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
